; void suma(unsigned int* v1, unsigned int* v2, unsigned short n);

global suma

%define ptr_v1 [ebp + 8]
%define ptr_v2 [ebp + 12]
%define n [ebp + 16]

section .text

suma:
	push ebp
	mov ebp, esp
	push esi
	push edi
	push ebx
	
	mov edi, ptr_v1
	mov esi, ptr_v2 
	xor ecx, ecx
	mov cx, n
	
ciclo:
	movq mm0, [esi + ecx * 8 - 8]
	paddd mm0, [edi + ecx * 8 - 8]
	movq [edi + ecx * 8 - 8], mm0
	loop ciclo
	
	emms
	
fin:
	pop ebx
	pop edi
	pop esi
	pop ebp
	ret
